Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add command to print the json schema of the config #361

Merged

Conversation

ecioppettini
Copy link
Contributor

I think it's nice to have some intellisense when editing the config, and we already have the json schemas for free with typebox.

I want this to use it with yaml-language-server like this:

./paima-engine-linux gen-config-json-schema | jq > config-json-schema.json

And then in config.localhost.yml

# yaml-language-server: $schema=config-json-schema.json

Network:
  type: evm-main
  chainUri: 'http://localhost:8545'
  chainId: 31337
  chainCurrencyName: 'ETH'
  chainCurrencySymbol: 'ETH'
  chainCurrencyDecimals: 18
  blockTime: 2
  paimaL2Contract: ...

@@ -17,6 +17,7 @@ import {
import { importOpenApiJson, importTsoaFunction } from './import.js';
import type { Template } from './types.js';
import RegisterRoutes, { EngineService } from '@paima/rest';
import { BaseConfigWithoutDefaults } from '@paima/utils/src/config/loading.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't use this kind of import style (referencing a .js file from an NPM path). It can cause issues with compilation units

Copy link
Contributor

@SebastienGllmt SebastienGllmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than my small comment, LGTM. We might want to consider adding this to all the templates so I created an issue to track this idea: PaimaStudios/paima-game-templates#70

@SebastienGllmt SebastienGllmt merged commit 9ee0fe3 into master May 8, 2024
@SebastienGllmt SebastienGllmt deleted the enzo/add-command-to-export-config-json-schema branch May 8, 2024 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants